import request from "@/utils/request";

// 租户分页查询
export function getTenantApi(pageNum, pageSize, tenantName, type) {
  return request({
    url: "/sys/tenant",
    method: "get",
    params: { pageNum, pageSize, tenantName, type }
  });
}
// 添加斗拱租户
export function postTenantApi(data) {
  return request({
    url: "/sys/tenant/dg",
    method: "post",
    data
  });
}
// 添加adapay租户
export function postTenantApApi(data) {
  return request({
    url: "/sys/tenant/ap",
    method: "post",
    data
  });
}

//获取单一租户
export function getOneTenantApi(tenantId) {
  return request({
    url: `/sys/tenant/${tenantId}`,
    method: "get"
  });
}
//修改斗拱租户
export function putOneTenantApi(tenantId, data) {
  return request({
    url: `/sys/tenant/${tenantId}/dg`,
    method: "put",
    data
  });
}
//修改adapay租户
export function putOneTenantApApi(tenantId, data) {
  return request({
    url: `/sys/tenant/${tenantId}/ap`,
    method: "put",
    data
  });
}
//获取超级管理员
export function getAdminApi(tenantId) {
  return request({
    url: `/sys/tenant/${tenantId}/user`,
    method: "get"
  });
}
//添加超级管理员
export function postAdminApi(tenantId, data) {
  return request({
    url: `/sys/tenant/${tenantId}/user`,
    method: "post",
    data
  });
}
//修改超级管理员
export function putAdminApi(tenantId, data) {
  return request({
    url: `/sys/tenant/${tenantId}/user`,
    method: "put",
    data
  });
}
// 获取超管权限
export function getRoleApi(id) {
  return request({
    url: `/sys/tenant/${id}/role`,
    method: "get"
  });
}
// 设置超管权限
export function setRoleApi(tenantId, data) {
  return request({
    url: `/sys/tenant/${tenantId}/role`,
    method: "post",
    data
  });
}
//获取DM二维码
export function postQrApi(tenantId, data) {
  return request({
    url: `/sys/tenant/${tenantId}/limit`,
    method: "post",
    data
  });
}
